import { createRouter, createWebHistory, RouteRecordRaw } from "vue-router";
import layOut from "../layout/index.vue";

export const constantRoutes: Array<RouteRecordRaw> = [
  {
    path: "/login",
    name: "Login",
    meta: {
      hidden: true,
    },
    component: () => import("../views/login.vue"),
  },
  {
    path: "",
    redirect:"/index",
    component: layOut,
    children: [
      {
        name: "Index",
        path: "/index",
        component: () => import("../views/index.vue"),
        meta: {
          title: "首页",
          affix:true,
          icon: "house",
          order_num: 0,
          menu_type: "C",
        },
      },
    ],
  },
  {
    path: '/:pathMatch(.*)*',
    component: () => import('../views/error/404.vue'),
    meta: {
      hidden: true,
    },
},
];
const router = createRouter({
  history: createWebHistory(),
  routes: constantRoutes,
});

export default router;
